Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtk(wayland): implement server-sided decorations #4724

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

pluiedev
Copy link
Contributor

@pluiedev pluiedev commented Jan 6, 2025

Fixes #4630 fully unless there exists an X11 API I haven't found yet :p

Depends on first commit of #4723, which is duplicated here for now

build.zig Outdated Show resolved Hide resolved
src/config/Config.zig Outdated Show resolved Hide resolved
src/config/Config.zig Outdated Show resolved Hide resolved
@pluiedev pluiedev force-pushed the push-xlsyxlkuzpqk branch 4 times, most recently from 4c235dd to 7eaed4c Compare January 8, 2025 13:41
@pluiedev pluiedev force-pushed the push-xlsyxlkuzpqk branch 2 times, most recently from 8216fce to 0eed411 Compare January 10, 2025 19:32
mitchellh added a commit that referenced this pull request Jan 10, 2025
There's one behavioral change here. Before this patch, if
`gtk-titlebar=false` we _never_ created a headerbar. This explicitly
contradicted the comments in the source, and the documentation for
`gtk-titlebar` imply that if a window starts out without a titlebar it
can be brought back later with the `toggle_window_decorations` keybind
action.

After this patch, a headerbar is always created, but if
`gtk-titlebar=false` or `window-decoration=false` it's immediately
hidden.

I'm not sure how this interacts with the current SSD/CSD detection that
seems to happen when running Ghostty on non-Gnome DEs so it'll be
important to get #4724 merged (plus any follow ups) to enable more
explicit control of SSD/CSD.
@pluiedev pluiedev marked this pull request as ready for review January 12, 2025 19:48
@mitchellh
Copy link
Contributor

Alright I got KDE setup (optionally) in my NixOS environment, so I'm going to pull this down and hack on it soon.

@mitchellh
Copy link
Contributor

Made some changes:

  • macOS project changes since its not a boolean anymore
  • I did make the window-decoration value an enum of none, client, server. I think this does make more sense. It does allow for false and true will which makes it behave nicely with macOS. But the docs are pretty clear about all this.
  • Whenever possible, always avoid comparing an enum to exactly one value. Always use a switch so we can catch future cases we need to update when changing enum values.
  • Docs for window-decoration

@mitchellh mitchellh enabled auto-merge January 14, 2025 18:02
@mitchellh mitchellh disabled auto-merge January 14, 2025 18:08
@mitchellh mitchellh merged commit 3cdb9a7 into ghostty-org:main Jan 14, 2025
29 checks passed
@github-actions github-actions bot added this to the 1.1.0 milestone Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server-side decorations
3 participants